<%@ page import="org.sky.sys.util.DictUtils" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/view/inc/include.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<security:csrfMetaTags/>
<script type="text/javascript" src='${basepath}view/sys/datasource/sysdatasourceedit.js'></script>
<script type="text/javascript">
var DS_DRIVER = <%=DictUtils.getDictItem("DRIVER_CLASS_NAME") %>;
var _callbacks = $.Callbacks();
$(function() {
	
});
</script> 
</head>
<body>
<div class="easyui-panel" style="width:100%;height:100%;text-align: center;"
	 data-options="footer:'#editPageButtonsFt',fit:true,border:false">
		<form id="sysdatasourceaddeditform" class="easyui-form" method="post" style="padding: 5px"
			data-options="novalidate:true">
			<input type='hidden' name='id' id='id'/>
			<table style="width:100%">
				  <tr>
					<th><label>编号:</label></th>
					<td><input class="easyui-textbox" name="code"
						data-options="required:true"></input></td>
					<th><label>名称:</label></th>
					<td><input class="easyui-textbox" name="name"
						data-options="required:true"></input></td>
				  </tr>
				  <tr>
					<th><label>类型:</label></th>
					<td colspan="3"><input class="easyui-textbox" name="type" style="width: 350px" readonly
						data-options="required:true" value="com.alibaba.druid.pool.DruidDataSource"></input></td>
				  </tr>
				  <tr>
					<th><label>驱动名称:</label></th>
					<td colspan="3"><input class="easyui-combobox" name="driverClassName" style="width: 350px"
						data-options="required:true,
									  data:DS_DRIVER,
									  valueField:'code',
									  textField:'name'
									 "></input></td>
				  </tr>
				  <tr>
					<th><label>连接符:</label></th>
					<td colspan="3"><input class="easyui-textbox" name="url" style="width: 350px"
						data-options="required:true"></input></td>
				  </tr>
				  <tr>
					<th><label>数据库用户名:</label></th>
					<td><input class="easyui-textbox" name="username"
						data-options="required:true"></input></td>
					<th><label>数据库密码:</label></th>
					<td><input class="easyui-passwordbox" name="password"
						data-options="required:true"></input></td>
				  </tr>
				  <tr>
					<th><label>备注:</label></th>
					<td colspan="3"><input class="easyui-textbox" name="note" style="width: 350px;height: 50px"
						data-options="multiline:true"></input></td>
				  </tr>
			</table>
		</form>
</div>
<div id='editPageButtonsFt' style="text-align:center; padding:0px; top:0px">
	<a href="javascript:void(0)" class="easyui-linkbutton" iconCls='icon-database_connect'
	   onclick="testConnection()">测试连接</a>
	<a href="javascript:void(0)" class="easyui-linkbutton" iconCls='icon-save'
		onclick="submitSysDatasourceAddEditForm()">保存</a>
	<a href="javascript:void(0)" id='cloBtn' class="easyui-linkbutton" iconCls='icon-cancel'>关闭</a>
</div>
</body>
</html>